<div class="container">
  <div class="row">
    <div class="hero-text">
     <h1>用户列表</h1>
     <p class="lead">在这里管理所有用户</p>
     {{if .flash.error}}
    <blockquote>{{.flash.error}}</blockquote>
    {{end}}

    {{if .flash.notice}}
    <blockquote>{{.flash.notice}}</blockquote>
    {{end}}
   </div>
 </div>
</div>
<div class="container">
  <div class="row">
    <table class="table">
      <thead>
        <tr>
          <th>姓名</th>
          <th>剩余调休时间</th>
			{{if .IsAdmin}}
          <th>操作</th>
			{{end}}
			<th>调休记录</th>
        </tr>
      </thead>
      <tbody>
        {{range $user := .Users}}
        <tr>
          <td>{{$user.Name}}</td>
          <td>{{$user.Hours}}</td>
			{{if $.IsAdmin}}
          <td><a href="/Edit/{{$user.Id}}">修改</a> <a href="{{urlfor "MainController.Delete" ":id" $user.Id}}">删除</a></td>
			{{end}}
		<td><a href="/Record/List/{{$user.Id}}/1">查看</a></td>
        </tr>
        {{end}}
      </tbody>
		{{if .IsAdmin}}
      <tfoot>
        <tr>
          <td colspan="4"><a href="{{urlfor "MainController.Add"}}" title="添加用户">添加用户</a></td>
        </tr>
      </tfoot>
		{{end}}
    </table>
  </div>
</div>